<?php

class Helper_Array
{
	static function valuesOrderByLength($array)
	{
		usort($array,
		      create_function('$x,$y','return strlen($y) - strlen($x);')
		      );
		return $array;
	}
	
	static function keysOrderByLength($array)
	{
		uksort($array,
		       create_function('$x,$y','return strlen($y) - strlen($x);')
		      );
		return $array;
	}
	
	static function valuesAppend($array, $append)
	{
		/// @todo C1104 append can be an array 
		array_walk($array,
		           create_function('&$v,$k', '$v = $v . "'
		                           . (string) $append . '";')
		          );
		return $array;
	}
	
	static function valuesPrepend($array, $prepend)
	{
		/// @todo C1104 prepend can be an array
		array_walk($array,
		           create_function('&$v,$k', '$v = '
		                           . (string) $prepend . ' . $v;')
		          );
		return $array;
	}
	
	/// @todo static function keysAppend($array, $append)
}